var doc = null;
var arrFile = new Array( _ARRAY_ );
var arrOut = new Array( _OUT_ );
var bClass = _CLASS_;
var bset = _SET_;

for( var j=0; j<arrFile.length; j++ )
{
	doc = fl.createDocument();
	doc.frameRate = 24;
	doc.width = 1;
	doc.height = 1;
	doc.backgroundColor = '#ffffff';
	doc.importFile(arrFile[j],false);
	var lib = doc.library;
	for(var i = 0;i<lib.items.length;i++)
	{
	  var item = lib.items[i];
	  if(item.itemType == "bitmap"){
	   item.compressionType = "photo";
	   item.quality = 80;
	   if( bClass )
	   {
		   	item.linkageExportForAS = true;
			item.linkageExportInFirstFrame = true;
			item.linkageBaseClass = "flash.display.BitmapData";
			if( bset )
			{
				item.linkageClassName = "_CLASS_NAME_";
			}
			else
			{
				var className = "png"+item.name.substr(0, item.name.lastIndexOf("."));
				item.linkageClassName = className;
			}
	   }
	  }
	}
	
	var items = doc.getTimeline().layers[0].frames[0].elements;
	for(var i=0;i<items .length;i++){
		var item1=items[i];
		item1.x = 0;
		item1.y = 0;
	}
	
	doc.exportSWF(arrOut[j],true);
	doc.close(false); 
}
